class Solution
{
public:
    int removeDuplicates(vector<int>& nums)
    {

        int dest = 0;
        int cur = dest + 1;

        while (cur < nums.size())
        {
            if (nums[dest] == nums[cur])
            {
                nums.erase(nums.begin() + cur);
            }
            else
            {
                dest++;
                cur++;
            }
        }

        return nums.size();
    }
};